package RandVars;
import java.util.Random;


public class GeoRandVar {

	private double p;
	private double divisor;
	private Random rnd;
	
	public GeoRandVar(double probability)
	{
		p=probability;
		divisor=Math.log(1-p);
		rnd=new Random();
	}
	
	public double getDouble()
	{
		return Math.log(rnd.nextDouble())/divisor;
	}
}
